import config from "config";
import httpFetch from "share/httpFetch";

export default {
  /**
   * @param {{businessCode: string}} params
   * @param {boolean} update
   */
  saveGiftDeclare(params, update = false) {
    if (update) {
      return httpFetch.put(
        `${config.baseUrl}/api/gift/applyBill/updateGiftApplyBill`,
        params
      );
    }
    return httpFetch.post(
      `${config.baseUrl}/api/gift/applyBill/createGiftApplyBill`,
      params
    );
  },

  /**
   * @param {{businessCode: string}} params
   */
  getGiftDeclare(params) {
    return httpFetch.get(
      `${config.baseUrl}/api/gift/applyBill/getGiftApplyBill`,
      params
    );
  },

  /**
   * @param {{businessCode: string}} params
   */
  delGiftDeclare(params) {
    return httpFetch.delete(
      `${config.baseUrl}/api/gift/applyBill/deleteGiftApplyBill`,
      params
    );
  },
};
